home *** CD-ROM | disk | FTP | other *** search
- global gSIAnims, gSIAnimTable, gSIEventQ, gSIFlush, gSISystem, gSIAnimSprite, gSITextSprite, gSICurrMovie, goSIAnimAsset
-
- on IAInit
- set vSquirrel to []
- add(vSquirrel, ["05squirrel01.pct", -9, 430])
- add(vSquirrel, ["06squirrel01.pct", 37, 453])
- add(vSquirrel, ["07squirrel01.pct", 37, 457])
- add(vSquirrel, ["08squirrel01.pct", 53, 457])
- add(vSquirrel, ["09squirrel01.pct", 46, 455])
- add(vSquirrel, ["10squirrel01.pct", 43, 453])
- add(vSquirrel, ["01squirrel01.pct", 55, 458])
- add(vSquirrel, ["02squirrel02.pct", 92, 440])
- add(vSquirrel, ["03squirrel01.pct", 141, 411])
- add(vSquirrel, ["04squirrel01.pct", 189, 398])
- add(vSquirrel, ["05squirrel01.pct", 220, 428])
- add(vSquirrel, ["06squirrel01.pct", 266, 453])
- add(vSquirrel, ["07squirrel01.pct", 266, 457])
- add(vSquirrel, ["08squirrel01.pct", 282, 457])
- add(vSquirrel, ["09squirrel01.pct", 275, 455])
- add(vSquirrel, ["10squirrel01.pct", 272, 453])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["11.13squirrel01.pct", 271, 452])
- add(vSquirrel, ["12squirrel01.pct", 272, 453])
- add(vSquirrel, ["12squirrel01.pct", 272, 453])
- add(vSquirrel, ["12squirrel01.pct", 272, 453])
- add(vSquirrel, ["12squirrel01.pct", 272, 453])
- add(vSquirrel, ["12squirrel01.pct", 272, 453])
- add(vSquirrel, ["10squirrel01.pct", 272, 453])
- add(vSquirrel, ["01squirrel01.pct", 284, 458])
- add(vSquirrel, ["02squirrel02.pct", 321, 438])
- add(vSquirrel, ["03squirrel01.pct", 370, 409])
- add(vSquirrel, ["04squirrel01.pct", 418, 396])
- add(vSquirrel, ["05squirrel01.pct", 444, 428])
- add(vSquirrel, ["06squirrel01.pct", 490, 453])
- add(vSquirrel, ["07squirrel01.pct", 490, 457])
- add(vSquirrel, ["08squirrel01.pct", 506, 457])
- add(vSquirrel, ["09squirrel01.pct", 499, 455])
- add(vSquirrel, ["01squirrel01.pct", 507, 458])
- add(vSquirrel, ["02squirrel02.pct", 544, 440])
- add(vSquirrel, ["03squirrel01.pct", 593, 411])
- add(vSquirrel, ["04squirrel01.pct", 641, 398])
- set vSpidey to []
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -81])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -79])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -74])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -64])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -48])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -28])
- add(vSpidey, ["01.drop.spidey.2.pct", 312, -8])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 13])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 33])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 53])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 71])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["01.drop.spidey.2.pct", 311, 86])
- add(vSpidey, ["02.drop.spidey.2.pct", 310, 229])
- add(vSpidey, ["03.drop.spidey.2.pct", 310, 282])
- add(vSpidey, ["03.drop.spidey.2.pct", 310, 282])
- add(vSpidey, ["04.drop.spidey.2.pct", 310, 341])
- add(vSpidey, ["04.drop.spidey.2.pct", 310, 391])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["05.drop.spidey.2.pct", 312, 471])
- add(vSpidey, ["07.spidey.2.pct", 311, 460])
- add(vSpidey, ["02.walk.spidey.2.pct", 308, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 278, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 267, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 237, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 227, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 197, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 186, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 156, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 144, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 114, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 103, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 73, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 63, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", 33, 464])
- add(vSpidey, ["02.walk.spidey.2.pct", 22, 462])
- add(vSpidey, ["03.walk.spidey.2.pct", -8, 464])
- set vBird to []
- add(vBird, ["02.bird.2.pct", 18, 149])
- add(vBird, ["02.bird.2.pct", 40, 144])
- add(vBird, ["02.bird.2.pct", 62, 139])
- add(vBird, ["02.bird.2.pct", 83, 134])
- add(vBird, ["02.bird.2.pct", 105, 129])
- add(vBird, ["01.bird.2.pct", 120, 157])
- add(vBird, ["03.bird.2.pct", 142, 157])
- add(vBird, ["02.bird.2.pct", 182, 149])
- add(vBird, ["02.bird.2.pct", 204, 144])
- add(vBird, ["02.bird.2.pct", 226, 139])
- add(vBird, ["02.bird.2.pct", 247, 134])
- add(vBird, ["02.bird.2.pct", 269, 129])
- add(vBird, ["01.bird.2.pct", 284, 157])
- add(vBird, ["03.bird.2.pct", 306, 157])
- add(vBird, ["02.bird.2.pct", 346, 149])
- add(vBird, ["02.bird.2.pct", 368, 144])
- add(vBird, ["02.bird.2.pct", 390, 139])
- add(vBird, ["02.bird.2.pct", 411, 134])
- add(vBird, ["02.bird.2.pct", 433, 129])
- add(vBird, ["01.bird.2.pct", 448, 157])
- add(vBird, ["03.bird.2.pct", 470, 157])
- add(vBird, ["02.bird.2.pct", 510, 149])
- add(vBird, ["02.bird.2.pct", 532, 144])
- add(vBird, ["02.bird.2.pct", 554, 139])
- add(vBird, ["02.bird.2.pct", 575, 134])
- add(vBird, ["02.bird.2.pct", 597, 129])
- add(vBird, ["01.bird.2.pct", 612, 157])
- add(vBird, ["03.bird.2.pct", 634, 157])
- set vBee to []
- add(vBee, ["01.bee.2.pct", 647, 456])
- add(vBee, ["03.bee.2.pct", 603, 439])
- add(vBee, ["01.bee.2.pct", 560, 415])
- add(vBee, ["03.bee.2.pct", 513, 393])
- add(vBee, ["01.bee.2.pct", 476, 364])
- add(vBee, ["03.bee.2.pct", 439, 334])
- add(vBee, ["01.bee.2.pct", 438, 292])
- add(vBee, ["01.bee.2.pct", 496, 218])
- add(vBee, ["03.bee.2.pct", 542, 192])
- add(vBee, ["01.bee.2.pct", 587, 170])
- add(vBee, ["03.bee.2.pct", 611, 132])
- add(vBee, ["01.bee.2.pct", 605, 93])
- add(vBee, ["03.bee.2.pct", 566, 63])
- add(vBee, ["01.bee.2.pct", 522, 43])
- add(vBee, ["03.bee.2.pct", 473, 54])
- add(vBee, ["01.bee.2.pct", 428, 77])
- add(vBee, ["03.bee.2.pct", 397, 108])
- add(vBee, ["01.bee.2.pct", 372, 142])
- add(vBee, ["03.bee.2.pct", 340, 175])
- add(vBee, ["01.bee.2.pct", 288, 186])
- add(vBee, ["03.bee.2.pct", 236, 174])
- add(vBee, ["01.bee.2.pct", 216, 138])
- add(vBee, ["03.bee.2.pct", 242, 103])
- add(vBee, ["01.bee.2.pct", 274, 67])
- add(vBee, ["03.bee.2.pct", 244, 33])
- add(vBee, ["01.bee.2.pct", 199, 32])
- add(vBee, ["03.bee.2.pct", 153, 51])
- add(vBee, ["01.bee.2.pct", 140, 91])
- add(vBee, ["03.bee.2.pct", 134, 133])
- add(vBee, ["01.bee.2.pct", 143, 172])
- add(vBee, ["03.bee.2.pct", 170, 209])
- add(vBee, ["01.bee.2.pct", 205, 239])
- add(vBee, ["03.bee.2.pct", 246, 265])
- add(vBee, ["01.bee.2.pct", 296, 273])
- add(vBee, ["03.bee.2.pct", 345, 290])
- add(vBee, ["01.bee.2.pct", 405, 285])
- add(vBee, ["03.bee.2.pct", 458, 261])
- add(vBee, ["01.bee.2.pct", 501, 223])
- add(vBee, ["03.bee.2.pct", 481, 183])
- add(vBee, ["01.bee.2.pct", 450, 150])
- add(vBee, ["03.bee.2.pct", 401, 143])
- add(vBee, ["01.bee.2.pct", 349, 171])
- add(vBee, ["03.bee.2.pct", 305, 202])
- add(vBee, ["01.bee.2.pct", 281, 241])
- add(vBee, ["03.bee.2.pct", 268, 287])
- add(vBee, ["01.bee.2.pct", 288, 329])
- add(vBee, ["03.bee.2.pct", 329, 361])
- add(vBee, ["01.bee.2.pct", 349, 403])
- add(vBee, ["03.bee.2.pct", 309, 440])
- add(vBee, ["01.bee.2.pct", 259, 427])
- add(vBee, ["03.bee.2.pct", 209, 404])
- add(vBee, ["01.bee.2.pct", 159, 391])
- add(vBee, ["03.bee.2.pct", 104, 380])
- add(vBee, ["01.bee.2.pct", 54, 367])
- add(vBee, ["03.bee.2.pct", -6, 367])
- set gSIAnimTable to [#Squirrel: vSquirrel, #Spidey: vSpidey, #Bird: vBird, #Bee: vBee]
- set gSIAnims to ["th": [[#Squirrel, 0, 0], [#Bird, 0, 280]], "iv": [[#Squirrel, 0, 0], [#Spidey, 0, 0], [#Bird, 0, 0], [#Bee, 0, 0]], "hf": [[#Squirrel, 0, 0], [#Spidey, 0, 0], [#Bird, 0, 0], [#Bee, 0, 0]], "wd": [[#Squirrel, 0, 0], [#Bird, 0, 280], [#Spidey, -50, 0]], "ma": [[#Squirrel, 0, 0], [#Spidey, 0, 0], [#Bird, 0, 0], [#Bee, 0, 0]], "tr": [[#Squirrel, 0, 0], [#Spidey, 0, 0], [#Bird, 0, 0], [#Bee, 0, 0]], "sd": [[#Spidey, 0, 0], [#Bee, 0, 0]]]
- set goSIAnimAsset to birth(script "AssetManager", 7429)
- end
-
- on RunIdleAnim aSprite, aTextSprite, aModule, aAnimList, aDX, aDY
- global gTHRefresh
- set vFrames to count(aAnimList)
- set vSaveVis to the visible of sprite aSprite
- set vSaveVis2 to the visible of sprite aTextSprite
- set vSaveX to the locH of sprite aSprite
- set vSaveX2 to the locH of sprite aTextSprite
- set vSaveY to the locV of sprite aSprite
- set vSaveY2 to the locV of sprite aTextSprite
- set vSaveCast to the castNum of sprite aSprite
- set vSaveCast2 to the castNum of sprite aTextSprite
- set vSaveInk to the ink of sprite aSprite
- set vSaveInk2 to the ink of sprite aTextSprite
- puppetSprite(aSprite, 1)
- set the ink of sprite aSprite to 8
- set the stretch of sprite aSprite to 0
- set the visible of sprite aSprite to 1
- set the visible of sprite aTextSprite to 0
- set vHit to 0
- StartBufferingEvents()
- repeat with vI = 1 to vFrames
- set vNextTime to the timer + 5
- set vFrameInfo to getAt(aAnimList, vI)
- set the castNum of sprite aSprite to cast mGetAssetNo(goSIAnimAsset, aModule & "." & getAt(vFrameInfo, 1))
- set the locH of sprite aSprite to getAt(vFrameInfo, 2) + aDX
- set the locV of sprite aSprite to getAt(vFrameInfo, 3) + aDY
- updateStage()
- if the mouseDown then
- if the mouseCast = the castNum of sprite aSprite then
- set vHit to 1
- exit repeat
- end if
- end if
- repeat while the timer < vNextTime
- nothing()
- end repeat
- end repeat
- EndBufferingEvents()
- StartBufferingEvents()
- if vHit then
- set vFact to random(95)
- if vFact < 10 then
- set vFact to "FF0" & vFact
- else
- set vFact to "FF" & vFact
- end if
- set the castNum of sprite aSprite to cast mGetAssetNo(goSIAnimAsset, "FactBox")
- set the locH of sprite aSprite to (the stageRight - the stageLeft) / 2
- set the locV of sprite aSprite to (the stageBottom - the stageTop) / 2
- set the castNum of sprite aTextSprite to cast mGetAssetNo(goSIAnimAsset, vFact)
- set the locH of sprite aTextSprite to ((the stageRight - the stageLeft) / 2) - (the width of cast mGetAssetNo(goSIAnimAsset, "FactBox") / 2) + 6
- set the locV of sprite aTextSprite to ((the stageBottom - the stageTop) / 2) - (the height of cast mGetAssetNo(goSIAnimAsset, "FactBox") / 2) + 6
- set the ink of sprite aTextSprite to 1
- set the visible of sprite aTextSprite to 1
- updateStage()
- set vNextTime to the timer + 120
- repeat while the timer < vNextTime
- nothing()
- end repeat
- EndBufferingEvents()
- StartBufferingEvents()
- repeat while not (the mouseDown)
- nothing()
- end repeat
- EndBufferingEvents()
- StartBufferingEvents()
- if gSICurrMovie = "th" then
- set gTHRefresh to 1
- end if
- end if
- set the visible of sprite aSprite to vSaveVis
- set the castNum of sprite aSprite to vSaveCast
- set the locH of sprite aSprite to vSaveX
- set the locV of sprite aSprite to vSaveY
- set the ink of sprite aSprite to vSaveInk
- set the visible of sprite aTextSprite to vSaveVis2
- set the castNum of sprite aTextSprite to vSaveCast2
- set the locH of sprite aTextSprite to vSaveX2
- set the locV of sprite aTextSprite to vSaveY2
- set the ink of sprite aTextSprite to vSaveInk2
- puppetSprite(aSprite, 0)
- puppetSprite(aTextSprite, 0)
- updateStage()
- EndBufferingEvents()
- end
-
- on DoIdleAnim aSprite, aTextSprite, aModule
- set vList to getaProp(gSIAnims, aModule)
- set vAnim to getAt(vList, random(count(vList)))
- RunIdleAnim(aSprite, aTextSprite, aModule, getaProp(gSIAnimTable, getAt(vAnim, 1)), getAt(vAnim, 2), getAt(vAnim, 3))
- end
-
- on EnableIdleAnim aAnimSprite, aTextSprite
- set the timeoutMouse to 1
- set the timeoutKeyDown to 1
- set the timeoutLength to 2400
- set gSIAnimSprite to aAnimSprite
- set gSITextSprite to aTextSprite
- set the timeoutScript to "IdleScript"
- end
-
- on DisableIdleAnim
- set the timeoutScript to EMPTY
- end
-
- on IdleScript
- global gTHRefresh
- set vDoIdle to value(HSStateGet("opt", "Idle"))
- if not vDoIdle then
- exit
- end if
- DoIdleAnim(gSIAnimSprite, gSITextSprite, gSICurrMovie)
- if gSICurrMovie = "th" then
- set gTHRefresh to 1
- else
- if gSICurrMovie = "wd" then
- RefreshScreen()
- end if
- end if
- end
-